<?php

/*
	This file is part of Mandragon.

    Mandragon is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Mandragon is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Mandragon.  If not, see <http://www.gnu.org/licenses/>.
*/

require_once 'PHPUnit/Framework.php';
require_once 'autoload.php';

class TestFormCreator extends PHPUnit_Framework_TestCase {

	function test_header() {
		$expected_title = "Dark Dungeons";
		$expected_result = array('type' => 'header', 'title' => $expected_title);

		$creator = new FormCreator();	
		$actual = $creator->header($expected_title);
		$this->assertEquals($expected_result, $actual);
	}

	function test_info() {
		$expected_info = 'some info';
		$expected_hidden = 'some hidden';
		$expected_title = 'some title';
		$expected_unhidetext = 'some unhidetext';

		$expected_result = array(
				'type' => 'info',
				'info' => $expected_info,
				'hidden' => $expected_hidden,
				'title' => $expected_title,
				'unhidetext' => $expected_unhidetext);

		$creator = new FormCreator();
		$actual = $creator->info($expected_info, $expected_hidden, $expected_unhidetext, $expected_title);
		$this->assertEquals($expected_result, $actual);
	}
}


?>
